<?php
	$email 		= array('id'=>'email','class'=>'form-control', 'name'=>'email', 'value'=> set_value('email'),'type'=>'email','placeholder'=>'Tài khoản/Email','required'=>'');
	$password 	= array('id'=>'password', 'class'=>'form-control', 'name'=>'password', 'value'=> set_value('password'),'type'=>'password','placeholder'=>'Mật khẩu', 'required'=>'');
	$repassword = array('id'=>'repassword', 'class'=>'form-control', 'name'=>'repassword', 'value'=> set_value('repassword'),'type'=>'password','placeholder'=>'Nhập lại mật khẩu', 'required'=>'');
	$ho_ten 		= array('id'=>'ho_ten', 'class'=>'form-control', 'name'=>'ho_ten', 'value'=> set_value('ho_ten'),'type'=>'text','placeholder'=>'Họ và tên', 'required'=>'');
	$ngay_sinh 	= array('id'=>'ngay_sinh', 'class'=>'form-control datepicker text-right', 'name'=>'ngay_sinh', 'value'=> set_value('ngay_sinh'),'type'=>'input','autocomplete'=>'off', 'required'=>'');
	$hon_nhan 	= array('0'=>'Độc thân','1'=>'Đã kết hôn');
	$gioi_tinh 	= array('0'=>'Nữ','1'=>'Nam');
	// $tinh_thanh = array('1'=>'Tp Hồ Chi Mính','2'=>'Hà Nội','3'=>'Bình Dương');	
	// $dich_vu 	= array('1'=>'Model ảnh','2'=>'Model Catwalk','3'=>'Sự kiện / Hội nghị / Triển lãm','4'=>'Mẫu ảnh bikini / nội y / đầm ngủ','5'=>'PG Tiệc/ Du lịch');		
	$can_nang 	= array('id'=>'can_nang', 'class'=>'form-control', 'name'=>'can_nang', 'value'=> set_value('can_nang'),'required'=>'');
	$chieu_cao_m= array('id'=>'chieu_cao_m', 'class'=>'form-control', 'name'=>'chieu_cao_m', 'value'=> set_value('chieu_cao_m'),'maxlength'=>1,'required'=>'');
	$chieu_cao_cm= array('id'=>'chieu_cao_cm', 'class'=>'form-control', 'name'=>'chieu_cao_cm', 'value'=> set_value('chieu_cao_cm'),'maxlength'=>2,'required'=>'');
	$vong_1 		= array('id'=>'vong_1', 'class'=>'form-control', 'name'=>'vong_1', 'value'=> set_value('vong_1'),'maxlength'=>2,'required'=>'');
	$vong_2 		= array('id'=>'vong_2', 'class'=>'form-control', 'name'=>'vong_2', 'value'=> set_value('vong_2'),'maxlength'=>2,'required'=>'');
	$vong_3 		= array('id'=>'vong_3', 'class'=>'form-control', 'name'=>'vong_3', 'value'=> set_value('vong_3'),'maxlength'=>2,'required'=>'');
	$di_dong1 	= array('id'=>'di_dong1', 'class'=>'form-control', 'name'=>'di_dong1', 'value'=> set_value('di_dong1'),'required'=>'');
	$di_dong2 	= array('id'=>'di_dong2', 'class'=>'form-control', 'name'=>'di_dong2', 'value'=> set_value('di_dong2'));
	$tgian_tu = array('id'=>'tgian_tu', 'class'=>'form-control time start', 'name'=>'tgian_tu', 'value'=> set_value('tgian_tu'));
	$tgian_den = array('id'=>'tgian_den', 'class'=>'form-control time end', 'name'=>'tgian_den', 'value'=> set_value('tgian_den'));
	$yahoo 		= array('id'=>'yahoo', 'class'=>'form-control', 'name'=>'yahoo', 'value'=> set_value('yahoo'));
	$facebook 	= array('id'=>'facebook', 'class'=>'form-control', 'name'=>'facebook', 'value'=> set_value('facebook'));
	$hoc_van 	= array('id'=>'hoc_van', 'class'=>'form-control', 'name'=>'hoc_van', 'value'=> set_value('hoc_van'));
	$ngoai_ngu 	= array('id'=>'ngoai_ngu', 'class'=>'form-control', 'name'=>'ngoai_ngu', 'value'=> set_value('ngoai_ngu'));
	$nang_khieu = array('id'=>'nang_khieu', 'class'=>'form-control', 'name'=>'nang_khieu', 'value'=> set_value('nang_khieu'));
	$kinh_nghiem = array('id'=>'kinh_nghiem', 'class'=>'form-control', 'name'=>'kinh_nghiem', 'value'=> set_value('kinh_nghiem'),'style'=>'height:79px;');	
?>
<div class="col-md-12">	
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Đăng ký thành viên - <b>Bước 2: Nhập thông tin hồ sơ</b></h3>
		</div>
		<div class="panel-body">
			<div class="col-md-4 col-sm-4">
				<img src="<?=base_url('assets/img/profile-icon.png')?>" alt="profile-icon.png"/>
			</div>
			<div class="col-md-8 text-justify col-sm-8">
				<p>Việc tạo hồ sơ của bạn trên <font color="#28a4e0">PGVietnamWorks.vn</font> hoàn toàn miễn phí.</p>
				<p>Hồ sơ càng chi tiết thông tin sở trường, kinh nghiệm làm việc và hình ảnh đẹp giới thiệu về bản thân sẽ càng hấp dẫn Nhà Tuyển Dụng tìm đến với bạn.</p>
				<p>Vui lòng nhập thông tin bên dưới kèm theo hình thật của bạn để giới thiệu với Nhà Tuyển Dụng</p>
				<p><span style="color:red">(*)</span> là trường bắt buộc phải nhập</p>
			</div>
			<div class="col-md-3 clear col-sm-3"></div>	
			<div class="col-md-6 col-sm-6">
			<?php if ($message = $this->session->userdata('message')):?>
				<div class="alert alert-primary">
					<a class="close" data-dismiss="alert">×</a>
					<?php echo $message;$this->session->unset_userdata('message');?>
				</div>
			<?php endif;?>
			<?php if ($danger = $this->session->userdata('danger')):?>
				<div class="alert alert-danger">
					<a class="close" data-dismiss="alert">×</a>
					<?php echo $danger;$this->session->unset_userdata('danger');?>
				</div>
			<?php endif;?>
			<?php if(isset($error)):?>
				<div class="alert alert-danger">
					<a class="close" data-dismiss="alert">×</a>
					<?php echo $error;?>
				</div>
			<?php endif;?>
			</div>
			<div class="col-md-3 col-sm-3"></div>
			<form role="form" action="" method="post">
			<div class="col-md-6 col-sm-6">
				<div class="panel panel-primary">
					<div class="panel-heading">
					  <h3 class="panel-title text-center">Thông tin tài khoản</h3>
					</div>
					<div class="panel-body" style="overflow: visible;">				
						<div class="form-group">
							<label for="email">Email <span style="color:red">(*)</span></label>					
							<?php echo form_input($email);?>
						</div>					
						<table width="100%">
							<tr>
								<td class="table-control w50">
									<div class="form-group">
										<label for="password">Mật khẩu <span style="color:red">(*)</span></label>
										<?php echo form_input($password);?>
									</div>
								</td>
								<td class="table-control">
									<div class="form-group">
										<label for="repassword">Nhập lại <span style="color:red">(*)</span></label>
										<?php echo form_input($repassword);?>
									</div>
								</td>
							</tr>
						</table>
						<div class="form-group">
							<label for="ho_ten">Họ và tên <span style="color:red">(*)</span></label>
							<?php echo form_input($ho_ten);?>
						</div>
						<table width="100%">
							<tr>
								<td class="table-control" style="width:50%">
									<div class="form-group relative">
										<label for="ngay_sinh">Ngày sinh <span style="color:red">(*)</span></label>
										<?php echo form_input($ngay_sinh);?>
									</div>
								</td>
								<td class="table-control">
									<div class="form-group">
										<label for="hon_nhan">Hôn nhân</label>
										<?php echo form_dropdown('hon_nhan',$hon_nhan,set_value('hon_nhan')?set_value('hon_nhan'):0,'class="form-control"');?>
									</div>
								</td>
							</tr>
						</table>
						<table width="100%">
							<tr>
								<td class="table-control align-top">
									<div class="form-group">
										<label for="gioi_tinh">Giới tính</label>
										<?php echo form_dropdown('gioi_tinh',$gioi_tinh,set_value('gioi_tinh')?set_value('gioi_tinh'):0,'class="form-control "');?>
									</div>
									<div class="form-group">
										<label for="tinh_thanh">Nơi ở hiện tại</label>	
										<?php #echo form_dropdown('tinh_thanh',$tinh_thanh,set_value('tinh_thanh'),'class="form-control "');?>
										<?php echo form_dropdown('tinh_thanh',$tinh_thanh,set_value('tinh_thanh'),'class="form-control" title="Chọn Tỉnh/Thành Phố"  onchange="get_quan_huyen(this);"');?>
									</div>
									<div class="form-group" id="quan_huyen_wrap">
										<?php echo form_dropdown('quan_huyen',$quan_huyen,set_value('quan_huyen'),'class="form-control"');?>
									</div>														
								</td>
								<td class="table-control text-center align-top" style="width:50%">
									<label>Ảnh đại diện</label>
									<div id="file-uploader">		
									</div>
									<script type="text/javascript">        
										function createUploader(){            
											var ajaxuploader = new qq.FileUploader({
												element: document.getElementById('file-uploader'),
												action: "<?php echo base_url('upload/upload_files');?>",
												allowedExtensions: ['jpg', 'jpeg', 'png', 'gif', 'bmp'],
												multiple	: false,
												debug: false,
												template:   '<div class="qq-uploader">' +
													'<div class="qq-upload-drop-area"><span>{dragText}</span></div>' +
													'<div class="qq-upload-btn "><img class="qq-upload-btn img-thumbnail" src="<?=set_value('avatar')?base_url('uploads/images/full/'.set_value('avatar')):base_url('assets/img/option_register_1.png')?>"/><img id="loading" class="hide" src="/assets/css/loading.gif"/><span id="progress"></span></div></div>' +
													'<ul class="qq-upload-list" style="display:none"></ul>' +
													'</div>',
												fileTemplate: '<li class="avatar">' +
													'<span class="avatar qq-progress-bar"></span>' +
													'<span class="qq-upload-spinner"></span>' +
													'<span class="avatar qq-upload-finished"></span>' +
													'<span class="avatar qq-upload-file"></span>' +
													'<span class="avatar qq-upload-size"></span>' +
													'<a class="avatar qq-upload-cancel btn btn-danger" href="#">{cancelButtonText}</a>' +
													'<span class="avatar qq-upload-failed-text alert alert-danger">{failUploadtext}</span>' +
													'</li>',
												classes: {
													// used to get elements from templates
													button: 'qq-upload-btn',
													list: 'qq-upload-list',
													drop: 'qq-upload-drop-area',
													progressBar: 'qq-progress-bar',
													file: 'qq-upload-file',
													spinner: 'qq-upload-spinner',
													finished: 'qq-upload-finished',
													size: 'qq-upload-size',
													cancel: 'qq-upload-cancel',
													// added to list item <li> when upload completes
													// used in css to hide progress spinner
													success: 'qq-upload-success',
													fail: 'qq-upload-fail',
													successIcon: null,
													failIcon: null,
												},
												onProgress: function(id, fileName, loaded, total){
													jQuery('#loading').removeClass('hide');
													jQuery('#progress').html(Math.round(loaded*100/total)+'%');
												},
												showMessage: function(message){
													alert(message);
												},
												onError: function(id, fileName, xhr){
													console.log(xhr);
												},
												onComplete: function(id, fileName, responseJSON){
													var img = responseJSON;
													jQuery('.qq-upload-btn.img-thumbnail').attr('src','/assets/timthumb.php?w=160&h=170&src=/uploads/images/full/'+img.filename);
													jQuery('#avatar').val(img.filename);
													jQuery('#loading').addClass('hide');
													jQuery('#progress').html('');
												},
											});   
										}
										window.onload = createUploader;							
									</script>
									<input type="hidden" id="avatar" name="avatar" value="<?=set_value('avatar')?>"/>
								</td>
							</tr>
							<tr>
								<td colspan="1">
									<div class="form-group">
										<label for="dich_vu">Sở trường <span style="color:red">(*)</span></label>
										<?php $dich_vu = $this->session->flashdata('dich_vu');
											if(!$dich_vu) $dich_vu = array();
										?>
										<?php echo form_multiselect('dich_vu[]',$dichvu,$dich_vu,'class="form-control multiselect" style="width:60%;"');?>
									</div>
								</td>
								<td></td>
							</tr>
							<tr>
								<td class="table-control w50">
									<div class="form-group">																
										<label for="captcha">Nhập mã bảo mật <span style="color:red">(*)</span></label>
										<input type="input" class="form-control" id="captcha" autocomplete="off" name="captcha" required>
									</div>
								</td>
								<td class="table-control">
									<div class="form-group">
										<label for="captcha"><font color="#fff">Mã bảo mật - Mã captcha</font></label>
										<?=$captcha?>
									</div>
								</td>
							</tr>
						</table>								
					</div>
				</div>
			</div>
			<div class="col-md-6 col-sm-6">
				<div class="panel panel-primary">
					<div class="panel-heading">
					  <h3 class="panel-title text-center">Thông tin cá nhân</h3>
					</div>
					<div class="panel-body">				
						<table width="100%">
							<tr>
								<td class="table-control w33">
									<div class="form-group">
										<label for="can_nang">Cân nặng(kg) <span style="color:red">(*)</span></label>
										<?php echo form_input($can_nang);?>
									</div>
								</td>
								<td class="table-control w33">
									<div class="form-group">
										<label for="chieu_cao_m">Chiều cao(m) <span style="color:red">(*)</span></label>
										<?php echo form_input($chieu_cao_m);?>
									</div>
								</td>
								<td class="table-control w33">
									<div class="form-group">
										<label for="chieu_cao_cm">Chiều cao(cm) <span style="color:red">(*)</span></label>
										<?php echo form_input($chieu_cao_cm);?>
									</div>
								</td>
							</tr>
						</table>
						<table width="100%">
							<tr>
								<td class="table-control w33">
									<div class="form-group">
										<label for="vong_1">Vòng 1 <span style="color:red">(*)</span></label>
										<?php echo form_input($vong_1);?>
									</div>
								</td>
								<td class="table-control w33">
									<div class="form-group">
										<label for="vong_2">Vòng 2 <span style="color:red">(*)</span></label>
										<?php echo form_input($vong_2);?>
									</div>
								</td>
								<td class="table-control w33">
									<div class="form-group">
										<label for="vong_3">Vòng 3 <span style="color:red">(*)</span></label>
										<?php echo form_input($vong_3);?>
									</div>
								</td>
							</tr>
						</table>
						<table width="100%">
							<tr>
								<td class="table-control" style="width:50%">
									<table width="100%">
										<tr>
											<td class="table-control" style="width:50%">
												<div class="form-group datepairExample">
													<label class="tgian_tu">Thời gian từ</label>
													<?php echo form_input($tgian_tu);?>
												</div>
											</td>
											<td class="table-control">
												<div class="form-group datepairExample">
													<label for="tgian_den">đến</label>
													<?php echo form_input($tgian_den);?>
												</div>
											</td>
										</tr>
									</table>
								</td>
								<td class="table-control">
									
								</td>
							</tr>
							<tr>
								<td class="table-control w50">
									<div class="form-group">
										<label for="di_dong1">Di động 1 <span style="color:red">(*)</span></label>								
										<?php echo form_input($di_dong1);?>
									</div>
								</td>
								<td class="table-control">
									<div class="form-group">
										<label for="di_dong2">Di động 2</label>
										<?php echo form_input($di_dong2);?>
									</div>
								</td>
							</tr>
							<tr>
								<td class="table-control w50">
									<div class="form-group">
										<label for="yahoo">Nick Yahoo</label>
										<?php echo form_input($yahoo);?>
									</div>
								</td>
								<td class="table-control">
									<div class="form-group">
										<label for="facebook">Facebook</label>
										<?php echo form_input($facebook);?>
									</div>
								</td>
							</tr>
						</table>
						<table width="100%">
							<tr>
								<td class="table-control w50">
									<div class="form-group">
										<label for="hoc_van">Học vấn</label>
										<?php echo form_input($hoc_van);?>
									</div>
								</td>
								<td class="table-control">
									<div class="form-group">
										<label for="ngoai_ngu">Ngoại ngữ</label>
										<?php echo form_input($ngoai_ngu);?>
									</div>
								</td>
							</tr>
						</table>
						<div class="form-group">
							<label for="nang_khieu">Năng khiếu khác</label>
							<?php echo form_input($nang_khieu);?>
						</div>
						<div class="form-group">
							<label for="kinh_nghiem">Kinh nghiệm làm việc</label>
							<?php echo form_textarea($kinh_nghiem);?>
						</div>				
					</div>
					<script type="text/javascript" src="<?=base_url('assets/js/jquery.timepicker.js')?>"></script>
					<script type="text/javascript" src="<?=base_url('assets/js/datepair.js')?>"></script>
					<script type="text/javascript" src="<?=base_url('assets/js/jquery.datepair.js')?>"></script>
					<link rel="stylesheet" type="text/css" href="<?=base_url('assets/css/jquery.timepicker.css')?>"/>
					<script>
						jQuery('.datepairExample .time').timepicker({
						  'showDuration': true,
						  'timeFormat': 'H:i'				  
						});
						jQuery('.datepairExample').datepair();
					</script>
				</div>
			</div>
			<div class="col-md-12 col-sm-12">
				<div class="panel panel-primary">
					<div class="panel-heading">
					  <h3 class="panel-title text-center">Album ảnh</h3>
					</div>
					<div class="panel-body">
						<input type="hidden" id="album" name="album" value="<?=set_value('album')?>"/>
						<?php $base_img = '/assets/timthumb.php?w=150&src=/uploads/images/full/';
							$tmp = set_value('album');
							$album	= $tmp ? json_decode($tmp) : array();
						?>
						<div id="file-uploader1" class=" text-center"></div>
						<script type="text/javascript">        
							jQuery(function(){
								var tmp = new qq.FileUploader({
									element: document.getElementById('file-uploader1'),
									action: "<?php echo base_url('upload/upload_files');?>",
									allowedExtensions: ['jpg', 'jpeg', 'png', 'gif', 'bmp'],
									multiple	: true,
									debug: false,
									template:   '<div class="qq-uploader">' +
										'<div class="qq-upload-drop-area1"><span>{dragText}</span></div>' +
										'<div class="qq-upload-btn1"><input type="button" name="btn_image" value="Upload ảnh" alt="image" title="Upload nhiều hình để tạo album ảnh" class="btn btn-default"><img class="loading hide" src="/assets/css/loading.gif"/><span id="filename"></span></div>' +
										'<ul class="qq-upload-list1 hide"></ul>' +
										'</div>',
									fileTemplate: '<li class="avatar">' +
										'<span class="avatar qq-progress-bar1"></span>' +
										'<span class="qq-upload-spinner1"></span>' +
										'<span class="avatar qq-upload-finished1"></span>' +
										'<span class="avatar qq-upload-file1"></span>' +
										'<span class="avatar qq-upload-size1"></span>' +
										'<a class="avatar qq-upload-cancel1 btn btn-danger" href="#">{cancelButtonText}</a>' +
										'<span class="avatar qq-upload-failed-text1 alert alert-danger">{failUploadtext}</span>' +
										'</li>',
									classes: {
										// used to get elements from templates
										button: 'qq-upload-btn1',
										list: 'qq-upload-list1',
										drop: 'qq-upload-drop-area1',
										progressBar: 'qq-progress-bar1',
										file: 'qq-upload-file1',
										spinner: 'qq-upload-spinner1',
										finished: 'qq-upload-finished1',
										size: 'qq-upload-size1',
										cancel: 'qq-upload-cancel1',
										success: 'qq-upload-success1',
										fail: 'qq-upload-fail1',
										successIcon: null,
										failIcon: null,
									},
									showMessage: function(message){
										alert(message);
									},
									onError: function(id, fileName, xhr){
										console.log(xhr);
									},
									onProgress: function(id, fileName, loaded, total){
										jQuery('.loading').removeClass('hide');
										jQuery('#filename').html(fileName + ', '+Math.round(loaded*100/total)+'%');
									},
									onComplete: function(id, fileName, responseJSON){
										var img = responseJSON;
										var html = '<li>';
										html += '<img class="img-thumbnail" src="';
										html += '/assets/timthumb.php?w=140&src=/uploads/images/full/'+img.filename;
										html += '"/>';
										html += '</li>';
										jQuery('.hoso-list').append(html);
										var json = jQuery('#album').val();
										var array = [];
										if(json) array = JSON.parse(json);
										array.push(img.filename);
										jQuery('#album').val(JSON.stringify(array));
										jQuery('.loading').addClass('hide');
									}
								});
							});
						</script>
						<ul class="hoso-list">
						<?php foreach($album as $obj):?>
							<li>
								<img class="img-thumbnail" src="<?=$base_img.$obj?>"/>
							</li>
						<?php endforeach;?>
						</ul>
					</div>
				</div>
				<div class="col-md-3 col-sm-3"></div>
				<div class="col-md-9 col-sm-9">
					<div class="checkbox text-left">
						<label>
							<input id="dong_y" type="checkbox" required> Tôi chấp nhận các <a href="/thoa-thuan-su-dung.html" target="_blank">Thỏa thuận sử dụng &amp; Quy định bảo mật</a> website
						</label>
					</div>
				</div>
				<div class="text-center">
					<?/*<button type="reset" class="btn btn-danger clearfix">Nhập lại</button>*/?>
					<button type="submit" class="btn btn-primary clearfix submit" disabled>Tiếp >></button>
				</div>
				<script type="text/javascript">
					jQuery('#dong_y').change(function(){
						if(jQuery('#dong_y').is(':checked'))
							jQuery('.submit').removeAttr('disabled');
						else
							jQuery('.submit').attr('disabled','');
					});
				</script>
			</div>
			</form>
		</div>		
	</div>	
</div>
<link href="<?=base_url('assets/css/fileuploader.css')?>" rel="stylesheet" type="text/css">
<script src="<?=base_url('assets/js/fileuploader.js')?>"></script>